<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/css/layui.css" th:href="@{/css/layui.css}" rel="stylesheet">
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
						<input id="id" name="id" th:value="${bzClassification.id}"  type="hidden">
							<div class="form-group">	
								<label class="col-sm-3 control-label">分类名称：</label>
								<div class="col-sm-8">
									<input id="name" name="name" th:value="${bzClassification.name}" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">壁纸类型：</label>
								<div class="col-sm-8">
									<select class="form-control" id="classType" name="classType">
										<option value="1" th:selected="${bzClassification.classType == '1'}">手机壁纸</option>
										<option value="2" th:selected="${bzClassification.classType == '2'}">动态壁纸</option>
										<option value="3" th:selected="${bzClassification.classType == '3'}">背景图</option>
										<option value="4" th:selected="${bzClassification.classType == '4'}">头像</option>
										<option value="5" th:selected="${bzClassification.classType == '5'}">表情包</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">是否启用：</label>
								<div class="col-sm-8">
									<select class="form-control" id="enable" name="enable" >
										<option value="1" th:selected="${bzClassification.enable == 1}">是</option>
										<option value="0" th:selected="${bzClassification.enable == 0}">否</option>
									</select>
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-3 control-label">图片类型：</label>
								<div class="col-sm-8">
									<input type="hidden" id="link" name="link" th:value="${bzClassification.link}">
									<button type="button" class="layui-btn" id="test1">
										<i class="fa fa-cloud"></i>上传文件
									</button>
									<div class="layui-upload-list">
										<img class="layui-upload-img" id="demo1"
											 style="width: 100px;height: 100px;" th:src="${bzClassification.imgUrl}">
									</div>
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">排序：</label>
								<div class="col-sm-8">
									<input id="sort" name="sort" th:value="${bzClassification.sort}" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">描述：</label>
								<div class="col-sm-8">
									<input id="description" name="description" th:value="${bzClassification.description}" class="form-control" type="text">
								</div>
							</div>


																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/wallpaper/bzClassification/edit.js" th:src="@{/js/appjs/wallpaper/bzClassification/edit.js}">
	</script>
	<script src="/js/layui.js" th:src="@{/js/layui.js}"></script>
	<script type="text/javascript">

		layui.use('upload', function () {
			var upload = layui.upload;
			//执行实例
			var uploadInst = upload.render({
				elem: '#test1', //绑定元素
				url: ctxPath+'common/sysFile/upload/domain', //上传接口
				size: 51200,
				accept: 'file',
				exts: 'jpg|png|jpeg|bpm',
				before: function(obj){
					//预读本地文件示例，不支持ie8
					obj.preview(function(index, file, result){
						$('#demo1').attr('src', result); //图片链接（base64）
					});
					//layer.msg('上传中', {icon: 16, time: 0});
				},
				done: function (res,index, upload) {
					layer.msg(res.msg);
					$('#link').val(res.fileName);
				},
				error: function (r) {
					layer.msg(r.msg);
				}
			});
		});


	</script>
</body>
</html>
